# Maintainer: Daniel Isenmann <daniel@archlinux.org>

pkgname=gegl
_tag='c7cd8520066a05c9502dfc93a39e97a9546dc824'
pkgver=0.4.46
pkgrel=2
pkgdesc='Graph based image processing framework'
arch=('loong64' 'x86_64')
url='https://www.gegl.org/'
license=('GPL3' 'LGPL3')
depends=('babl' 'cairo' 'gcc-libs' 'gdk-pixbuf2' 'glib2' 'glibc' 'jasper' 'json-glib' 'lcms2'
         'lensfun' 'libjpeg-turbo' 'libpng' 'libraw' 'librsvg' 'libspiro' 'libtiff' 'libwebp'
         'luajit' 'openexr' 'pango' 'poppler-glib' 'suitesparse')
makedepends=('ffmpeg' 'git' 'gobject-introspection' 'libgexiv2' 'meson' 'python-gobject' 'sdl2'
             'vala')
optdepends=('ffmpeg: FFmpeg Frame Loader and FFmpeg Frame Saver plugins'
            'graphviz: for gegl-introspect'
            'sdl2: SDL2 Display plugin')
# TODO(gromit): switch this back to the gnome gitlab on next build
source=("git+https://github.com/GNOME/gegl.git#tag=$_tag")
sha256sums=('SKIP')

pkgver() {
  cd "${pkgname}"
  git describe --tags | sed 's/^GEGL_//;s/_$//;s/_/./g;s/-/+/g'
}

build() {
  mkdir -p build
  cd build
  arch-meson ../"${pkgname}" \
    -Dworkshop=true \
    -Dmrg=disabled \
    -Dmaxflow=disabled
  ninja
}

check() {
  cd build
  ninja test || :
}

package() {
  cd build
  DESTDIR="${pkgdir}" ninja install
}
